let vm = new Vue({
    el: "form",
    data: {},
    methods: {
        login: function () {
            let data = new FormData(document.querySelector("form"));
            axios.post("/user/login", data).then(function (response) {
                if (response.data == 1) {
                    alert("登录成功");
                    location.href = "/admin.html";
                } else if (response.data == 2) {
                    alert("用户不存在");
                } else {
                    alert("密码错误");
                }
            })
        }
    }
})